package com.rdc.qingkou.ui;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

import com.rdc.qingkou.Application.MyApplication;
import com.rdc.qingkou.R;
import com.rdc.qingkou.utils.ACache;


public class ClearCacheDialogActivity extends AppCompatActivity {

    private ACache aCache;
    private Context context;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        MyApplication.addActivity(this);

        aCache = ACache.get(this);
        context = this;

        setContentView(R.layout.activity_clear_cache_dialog);

        findViewById(R.id.tv_cancel).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        findViewById(R.id.tv_confirm).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //清除缓存
                aCache.clear();
                Toast.makeText(context,"清除緩存成功！",Toast.LENGTH_SHORT).show();
                finish();
            }
        });
    }
}
